package memento.black_box;



/**
 * @Author: Doream
 * @Date: 2022/1/30 18:02
 */
// 黑箱备忘录，妙啊
public class Client {
    public static void main(String[] args) {
        System.out.println("----------------大战Boss前--------------------");
        GameRole gameRole = new GameRole();
        gameRole.initState();
        gameRole.stateDisplay();
        RoleStateCaretaker roleStateCaretaker = new RoleStateCaretaker();
        roleStateCaretaker.setMemento(gameRole.saveState());
        gameRole.fight();
        System.out.println("----------------大战Boss后--------------------");
        gameRole.stateDisplay();
        System.out.println("----------------不满意复原历史状态--------------------");
        gameRole.recoverState(roleStateCaretaker.getMemento());
        gameRole.stateDisplay();
    }
}
